package top.toptimus.dto.designStyle;

import lombok.Data;
import lombok.NoArgsConstructor;
import top.toptimus.dto.order.orderSync.orderCommit.DTODesignPoints;

import java.util.ArrayList;
import java.util.List;

/**
 * 设计点配置数据清洗DTO
 *
 * @author Doge
 */
@Data
@NoArgsConstructor
public class DesignPointDataCleanDTO {
    private String id;
    private String styleId;
    private String styleNameCN;
    private String pItemCD;
    private String pItemValue;
    private String pItemNameCN;
    private String defaultCD;
    private String defaultValue;
    private String defaultNameCN;
    private List<DesignPointDetailsDTO> designPointDetailsDTOs = new ArrayList<>();

    /**
     * 改orderCommit时用
     *
     * @return DTODesignPoints
     */
    public DTODesignPoints build() {
        return new DTODesignPoints(
                this.pItemNameCN,
                this.pItemCD,
                this.pItemValue,
                this.defaultValue,
                "1",
                "0",
                this.defaultValue,
                this.defaultNameCN,
                this.styleId
        );
    }
}
